Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions / Obtaining Information About an Endpoint


OTResolveAddress

Returns the protocol address that corresponds to the name of an endpoint.

C INTERFACE
OSStatus OTResolveAddress(EndpointRef ref, TBind* req, TBind* ret);
C++ INTERFACE
OSStatus TEndpoint::ResolveAddress(TBind* req, TBind* ret);
PARAMETERS
ref
The endpoint reference of the endpoint whose address is sought.
req
A pointer to a TBind structure (page 3-51). The req->addr.buf field points to a buffer containing the name of the endpoint, which must be in an appropriate format for the protocol family. For example, for AppleTalk this must be an NBP address.
ret
A pointer to a TBind structure (page 3-51). The ret->addr.buf field points to a buffer containing the lowest-level address that corresponds to the address pointed to by the req->addr.buf field of the req parameter.
DESCRIPTION
The OTResolveAddress function returns the lowest-level address for your endpoint. Not all endpoints support this function. A value of CAN_RESOLVE_ADDR in the flags field of the TEndpointInfo structure indicates that the endpoint does support this function. Using this function saves you the trouble of opening and closing a mapper provider if the only reason you have for opening the mapper is to look up the address corresponding to a specific endpoint name. You would still have to open the mapper if you needed to look up a name pattern--that is, if the name included any wildcard characters.

You are responsible for initializing the buffers described by the req and ret parameters required to hold the addresses. To determine how large these buffers should be, examine the addr field of the TEndpointInfo structure, which specifies the maximum amount of memory needed to store an address for the endpoint specified by the ref parameter.

If a notifier is not installed, it is not possible to determine when the OTResolveAddress function completes.

COMPLETION EVENT CODES
T_RESOLVEADDRCOMPLETE0x20000009The OTResolveAddress function has completed. The cookie parameter of the notifier function contains the result parameter.
VALID STATES
All states are valid except T_UNINT.

SEE ALSO
For additional information about the format used to describe the address passed in the ret parameter, please consult the documentation provided for the protocol you are using as the lowest-level protocol.

The TBind structure (page 3-51) describes the address to which an endpoint
is bound.

The flags field (page 3-45) of the TEndpointInfo structure (page 3-48) indicates whether the endpoint supports this function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996